package com.jdd.modules.sdk.ledcall;

import com.jdd.common.constant.JddConstant;
import com.jdd.common.constant.LedConstant;
import com.jdd.common.util.CurrencyConvertUtils;
import com.jdd.common.util.DateUtil;
import com.jdd.common.util.DateUtils;
import com.jdd.common.util.StringSeparatedUtil;
import com.jdd.modules.sdk.LedCallInterface;
import com.jdd.modules.sdk.SdkCallInterface;
import com.jdd.modules.sdkidentifyresultpushlog.entity.DiscountCouponDetail;
import com.jdd.modules.sdkidentifyresultpushlog.entity.ParkOrderInfoVO;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @author ：jdd孙庆伟
 * @date ：Created in 2021/10/18 11:26
 * @description：
 * @modified By：`
 * @version: 1.0
 */
@Component
@Lazy
public class XiaoMingLedCallInterface extends LedCallInterface {
    @Resource
    private SdkCallInterface sdkCallInterface;

    /**
     * @return
     * @Description 无牌车入口显示播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceUnlicensed(String serialNo) {
        String str = "请扫码入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 军警车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceSpecial(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = plateNo + "欢迎光临";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        String sepStr = StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:11
     * @Description 白名单过期按照临时车
     */
    @Override
    public void EntranceParkWhiteOver(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "白名单时效已过出场将按临时车收费", LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        String sepStr = "临时车," + StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:12
     * @Description 月租车过期禁止进入
     */
    @Override
    public void BanMonthOver(String serialNo, String plateNo, Date endTime,String broadcastInfo) throws Exception {
        String str = "月租车" + plateNo + "已于" + DateUtil.formatDate(endTime, "yyyy-MM-dd") + "过期禁止入场!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "过期禁止入场", LedConstant.xmTwoLine);
        String sepStr = "月租车," + StringSeparatedUtil.getSepStr(plateNo) + ",请延期";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:13
     * @Description 过期N天不可进入
     */
    @Override
    public void BanMonthOverDay(String serialNo, String plateNo, Date endTimes) throws Exception {
        String str = "月租车" + plateNo + "已于" + DateUtil.formatDate(endTimes, "yyyy-MM-dd") + "过期禁止入场请联系管理员!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请联系管理员", LedConstant.xmTwoLine);
        String sepStr = "月租车," + StringSeparatedUtil.getSepStr(plateNo) + ",卡已过期,请联系管理员";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:14
     * @Description 过期N天内可进入
     */
    @Override
    public void EnranceMonthOverCan(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "月租车" + plateNo + "月租时效已过,出场将按照临时车收费";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请入场停车", LedConstant.xmTwoLine);
        String sepStr = "月租车," + StringSeparatedUtil.getSepStr(plateNo) + ",卡已过期,请联系管理员";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车过期按照临时车收费播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceMonthlyOverdue(String serialNo, String plateNo) {
        String str = "月租车" + plateNo + "月租时效已过,出场将按照临时车收费";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String sepStr = "月租车," + StringSeparatedUtil.getSepStr(plateNo) + ",卡已过期,请入场";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void MonthlyEntrance(String serialNo, String plateNo,String broadcastInfo) {
        String str = "月租车" + plateNo + "欢迎光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String sepStr = "月租车," + StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * 月租车出场
     * @param serialNo
     * @param plateNo
     * @param broadcastInfo
     * @return
     * @author renshangyi
     * @date 2022/4/1
     */
    @Override
    public void outMonthlyEntrance(String serialNo, String plateNo, String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 黑名单禁止通行播报 如果是黑名单并且iFBroadcast为false 则限制入场
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceBlacklist(String serialNo, String plateNo) {
        String str = "黑名单车牌号" + plateNo + "禁止入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str.trim(), LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo.trim(), LedConstant.xmTwoLine);
        String sepStr = "黑名单车牌," + StringSeparatedUtil.getSepStr(plateNo) + ",禁止入场";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @param serialNo
     * @return
     * @Description 禁行时间段内播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void JudgeStopDay(String serialNo, String plateNo) {
        String str = "非通行时段禁止入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "非通行时段,禁止入场");
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:18
     * @Description 储值车配置自动开闸
     */
    @Override
    public void EntranceStoredInConfig(String serialNo, String plateNo) {
        String str = "充值车" + plateNo + "欢迎光临";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String sepStr = "充值车," + StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:19
     * @Description 储值车配置手动开闸
     */
    @Override
    public void StoredInConfig(String serialNo, String plateNo) {
        String str = "请联系管理员";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "请联系管理员");
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:19
     * @Description 储值车无配置自动开闸
     */
    @Override
    public void EntranceStoredNoConfig(String serialNo, String plateNo) {
        String str = "充值车" + plateNo + "欢迎光临";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String sepStr = "充值车," + StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryEntrance(String serialNo, String plateNo) {
        String str = "临时车" + plateNo + "欢迎光临";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String sepStr = "临时车," + StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车禁止入场播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryBanEntrance(String serialNo,String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车禁止入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String strBr = sdkCallInterface.getOverdueType(plateNo)+",临时车,禁止入场";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, strBr);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场车位已满, 禁止通行播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryEntranceParkingFull(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车车位已满禁止入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String strBr = sdkCallInterface.getOverdueType(plateNo)+",临时车,车位已满,禁止入场";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, strBr);
    }

    /**
     * 临时车位已满 确认开闸
     *
     * @param serialNo
     * @param plateNo
     * @return void
     * @author jdd孙庆伟
     * @date 2021/8/31 14:57:35
     * @version 1.0
     */
    @Override
    public void TemporaryEntranceFullConfirmOpened(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车位已满正在人工确认";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String strBr = sdkCallInterface.getOverdueType(plateNo)+",临时车,车位已满,正在人工确认";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, strBr);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:22
     * @Description 临时车位未满配置自动开闸
     */
    @Override
    public void TemporaryEntranceInConfig(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车"+plateNo+"欢迎光临";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        String sepStr = sdkCallInterface.getOverdueType(plateNo)+",临时车," + StringSeparatedUtil.getSepStr(plateNo) + ",欢迎光临";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:22
     * @Description 临时车位未满配置确认开闸
     */
    @Override
    public void TemporaryInConfig(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车正在人工确认";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        String strBr = sdkCallInterface.getOverdueType(plateNo)+",临时车,正在人工确认";
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, strBr);
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 无牌车出场
     */
    @Override
    public void OutUnlicensed(String serialNo) {
        String str = "无牌车请扫描出口二维码";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String fourLineStr = "请扫描出口二维码";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, fourLineStr, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "请扫码出场");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 特殊车出场
     */
    @Override
    public void OutSpecial(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "祝您一路顺风";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "一路顺风");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 白名单出场
     */
    @Override
    public void OutParkWhite(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = plateNo + "祝您一路顺风";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "白名单", LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "一路顺风");

    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 月租车出场
     */
    @Override
    public void OutMonthly(String serialNo, String plateNo) {
        // 直接抬杆
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = plateNo + "祝您一路顺风";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "一路顺风");

    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 调用计费规则异常处理
     */
    @Override
    public void OutAbnormal(String serialNo, String plateNo) {
        String str = "未识别到车辆信息";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "请联系管理员");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 无异常 无入场记录不抬杆
     */
    @Override
    public void OutAbnormalBan(String serialNo, String plateNo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "没有找到入场车牌请联系管理员", LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "请联系管理员");

    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 无异常 无入场记录免费放行
     */
    @Override
    public void OutAbnormalCan(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, JddConstant.AdmissionRecordsCarType.FREE_RELEASE_MESSAGE, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "一路顺风");

    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 停车费已支付处理
     */
    @Override
    public void OutPayParkingFee(String serialNo, String plateNo) {
        String str = "祝您一路顺风";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "一路顺风");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 使用免费时长券/全免券/小时券的订单
     */
    @Override
    public void OutDiscount(String serialNo, String plateNo, DiscountCouponDetail discountCouponDetail) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "祝您一路顺风";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "一路顺风");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 储值车无入场纪录
     */
    @Override
    public void OutStoredNoInLogs(String serialNo, String plateNo) {
        String str = "未找到车辆入场记录";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "没有找到入场车牌");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 储值车缴费出场
     */
    @Override
    public void OutStoredPayFee(String serialNo, String plateNo, Integer unpayFee, Integer remaining, ParkOrderInfoVO parkOrderInfoVO) {
        String str = "充值车" + plateNo + "本次停车" + DateUtils.turnDayHourMinuteString(String.valueOf(parkOrderInfoVO.getChargeDuration()))
                + "停车费用为" + unpayFee + "元" + "剩余" + remaining + "元";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, unpayFee + "元", LedConstant.xmTwoLine);
        //金额
        String chargeUnpaid = CurrencyConvertUtils.numToChinese(String.valueOf(unpayFee));
        String chargeUnpaidStr = StringSeparatedUtil.getSepStr(chargeUnpaid);
        //時間
        String chargeDurationStr = StringSeparatedUtil.getSpeDate(String.valueOf(parkOrderInfoVO.getChargeDuration()));
        //余额
        String remainingNum = CurrencyConvertUtils.numToChinese(String.valueOf(remaining));
        String remainingStr = StringSeparatedUtil.getSepStr(remainingNum);

        String sepStr = "充值车," + StringSeparatedUtil.getSepStr(plateNo) + ",本次收费," + chargeUnpaidStr + ",停车," + chargeDurationStr + ",剩余," + remainingStr;
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 调用计费规则异常处理
     */
    @Override
    public void OutStoredChargeAbnormal(String serialNo, String plateNo) {
        String str = "未识别到车辆信息";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "请联系管理员");
    }

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 播报收费信息
     */
    @Override
    public void OutShowFee(String serialNo, String plateNo, ParkOrderInfoVO parkOrderInfo) {
        String str = plateNo + "停车费用为" + Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100 + "元" + "本次停车" + DateUtils.turnDayHourMinuteString(parkOrderInfo.getChargeDuration().toString());
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        String chargeStr = Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100 + "元";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, chargeStr, LedConstant.xmTwoLine);
        //金额转换
        String chargeUnpaid = CurrencyConvertUtils.numToChinese(String.valueOf(Integer.parseInt(parkOrderInfo.getChargeUnpaid()) / 100));
        String chargeUnpaidStr = StringSeparatedUtil.getSepStr(chargeUnpaid);

        String chargeDurationStr = StringSeparatedUtil.getSpeDate(parkOrderInfo.getChargeDuration().toString());
        String sepStr = StringSeparatedUtil.getSepStr(plateNo) + ",本次收费," + chargeUnpaidStr + ",停车," + chargeDurationStr;
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, sepStr);
    }

    /**
     * 入场 确认开闸被拒绝
     *
     * @param serialNo
     * @param plateNo
     * @return void
     * @author jdd孙庆伟
     * @date 2021/9/1 11:29:40
     * @version 1.0
     */
    @Override
    public void RefuseCarEnter(String serialNo, String plateNo) {
        String str = "禁止入场,请联系管理员";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "禁止入场,请联系管理员");
    }

    /**
     * 重复入场
     */
    @Override
    public void repeatRecognitionConfirmOpened(String serialNo, String plateNo) {
        String str = plateNo+"重复入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * 月租车出场 播报收费信息
     * @param serialNo
     * @param plateNo
     * @param broadcastInfo
     * @return
     * @author renshangyi
     * @date 2022/4/1
     */
    @Override
    public void OutMonthlyShowFee(String serialNo, String plateNo, String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    /*** 功能描述: 场内码支付成功得，加上去缴费成功
     * @Author: lcy
     * @Date: 2022/1/19
     */
    @Override
    public void FieldFee(String serialNo, String plateNo) {
        String str = "缴费成功,祝您一路顺风";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "缴费成功,一路顺风");
    }

    /**
     * 临时车不收费出场
     * @param serialNo
     * @param plateNo
     */
    @Override
    public void FieldFeeOut(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "祝您一路顺风", LedConstant.xmOneLine);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.xmTwoLine);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, plateNo+",一路顺风");
    }
}
